/*
 * @Author: wilson 1207014631@qq.com
 * @Date: 2023-07-07 11:36:53
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-01-10 17:21:22
 * @Description:
 */
import { defineStore } from "pinia";
import { ref, reactive } from "vue";


export const useMenuStateStore = defineStore({
  id: "menuState",
  state: () => {
    let isCollapse = ref(false);
    const setCollapse = function (state:boolean) {
      isCollapse.value=state
    };
    return {
      setCollapse,
      isCollapse
    };
  },
  // 开启数据缓存
  persist: {
    enabled: true,
    strategies: [
      {
        key: "state", //设置存储的key  全部储存
        storage: localStorage,
        // paths: ["isCollapse"], //指定要长久化的字段  选择储存
      },
    ],
  },
});
